package com.ybxx.hr.service.impl;

import java.util.List;

import org.apache.commons.lang.StringUtils;

import com.ybxx.core.command.QueryFilter;
import com.ybxx.core.dao.GenericDao;
import com.ybxx.core.service.impl.BaseServiceImpl;
import com.ybxx.core.web.paging.PagingBean;
import com.ybxx.hr.dao.WorkTypeDao;
import com.ybxx.hr.model.Work;
import com.ybxx.hr.model.WorkType;
import com.ybxx.hr.service.WorkTypeService;

public class WorkTypeServiceImpl extends BaseServiceImpl<WorkType> implements
		WorkTypeService {
	private WorkTypeDao workTypeDao;
	public WorkTypeServiceImpl(WorkTypeDao dao) {
		super(dao);
		this.workTypeDao=dao;
		// TODO Auto-generated constructor stub
	}
	public List<WorkType> queryPage(WorkType workType,QueryFilter filter) {
		String hql="from WorkType wt";
		String condition=" where ";
		if(workType!=null && StringUtils.isNotEmpty(workType.getWtname())){
			hql+=condition+" wt.wtname='"+workType.getWtname()+"' ";
		}
		return workTypeDao.findByHql(hql, null,filter.getPagingBean());
	}
}
